import QtQuick 2.0
import QtQuick.Controls 2.12
Rectangle{
    width: parent.width
    height: 88
    color: "#374151"    
    property var view_model //1 安全  2 操作 3 设置
    signal viewChanged()
    
    Row{
        spacing: 40
        width: 296
        height: 72
        anchors.centerIn: parent
        Rectangle{
            color: view_model == 1 ? "#0085FF" : "transparent"
            width: 72
            height: 72
            radius: 8
            Image {
                width: 32
                height: 32                
                x: 20
                y:6
                source: "qrc:/scraper/imgs/scenes_icon.png"
            }
            Text {
                x: 18
                y:40
                text: "安全"
                font.family: "Microsoft YaHei"
                font.pixelSize: 18
                color: "#FCFCFC"
            }
        }
        Rectangle{
            color: view_model == 2 ? "#0085FF" : "transparent"
            width: 72
            height: 72
            radius: 8
            Image {
                width: 32
                height: 32                
                x: 20
                y:6
                source: "qrc:/scraper/imgs/trouch_icon.png"
            }
            Text {
                x: 18
                y:40
                text: "操作"
                font.family: "Microsoft YaHei"
                font.pixelSize: 18
                color: "#FCFCFC"
            }
            MouseArea{    
                anchors.fill: parent
                onClicked: {
                    if(view_model != 1) 
                    {
                        view_model = 2
                        viewChanged()
                    }

                }
            }
        }
        Rectangle{
            color: view_model == 3 ? "#0085FF" : "transparent"
            width: 72
            height: 72
            radius: 8
            Image {
                width: 32
                height: 32                
                x: 20
                y:6
                source: "qrc:/scraper/imgs/setting_icon.png"
            }
            Text {
                x: 18
                y:40
                text: "设置"
                font.family: "Microsoft YaHei"
                font.pixelSize: 18
                color: "#FCFCFC"
            }
            MouseArea{    
                anchors.fill: parent
                onClicked: {
                    if(view_model != 1) 
                    {
                        view_model = 3
                        viewChanged()
                    }
                }
            }
        }
    }
}